package demo.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author: MI
 * @Date: 2022/2/24/0:17
 * @Description:
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "KzzJcGg", description = "可转债减持公告")
public class KzzJcGg implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("正骨")
    private String secName;
    @ApiModelProperty("正骨CODE")
    private String secCode;

    //SZZB|SHZB
    @ApiModelProperty("交易所")
    private String jys;

    @ApiModelProperty("减持时间")

    private LocalDate jcDate;

    @ApiModelProperty("可转债CODE")
    private String kzzCode;

    @ApiModelProperty("可转债-name")
    private String kzzName;

    @ApiModelProperty("减持")
    private List<KzzJcItem> itemList = new ArrayList<>();

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    @Data
    @Accessors(chain = true)
    @ApiModel(value = "KzzJcItem|可转债减持-具体子项", description = "可转债减持-具体子项")
    public static class KzzJcItem implements Serializable {
        private static final long serialVersionUID = 1L;
        @ApiModelProperty("持有人")
        private String cyr;

        @ApiModelProperty("持有数量")
        private String cySl;
        @ApiModelProperty("持有占发行量比例")
        private String cyZb;

        @ApiModelProperty("减持数量")
        private String jcNum;

        @ApiModelProperty("减持后数量")
        private String jchSl;
        @ApiModelProperty("减持后占比")
        private String jchZb;

        @Override
        public String toString() {
            return new ToStringBuilder(this).append("持有数量", cySl).append("\t").append("持有占发行量比例", cyZb).append("\t").append("减持数量", StringUtils.rightPad(jcNum, 8)).append("\t").append("减持后数量", jchSl).append("减持后占比", jchZb).append("持有人", cyr).toString();
            // return ToStringBuilder.reflectionToString(this);
        }
    }

}
